-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(chat): add /schema command handler VSCODE-571 #820
Conversation
}); | ||
await vscode.window.showTextDocument(document, { preview: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we show the schema in the Playground Result pane, like we display the result of executable code blocks from chat participants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with this approach, using a new json document view with preview, instead of a playground result pane for a couple reasons:
- It allows for JSON support.
- A preview is more ephemeral which is what I was thinking we want for something like this that folks want to copy paste or view quickly. It's replaced by other previews as well.
- This is the result of a schema run, and not something that is from running a playground, so naming it wouldn't be quite right.
Are there reasons we would want to reuse the result pane?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the results panel, you can also set the json language. I don't have a strong opinion on where the schema output should be, more like raising a question to think about. For me, the schema output looks pretty much the same as the export to language output, which we also show in the results pane. Only Shema will behave differently if we open it as a preview text document. On the other hand, we open documents from the sidebar also as json pages. If you feel strongly about this behavior, I don't mind keeping it as is. Just want to make sure this is what users would feel more natural about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'm merging it in like this - FWIW this is a pretty simple implementation to show a json doc, so we can swap it out easily down the line if we find using the playground results would be better.
VSCODE-571
Adds a schema command that passes a collection's schema to the model. With an open schema button. Uses the
mongodb-schema
package.REC-20240917172516.mp4